<template>
  <div>
    <el-form ref="setManually" :model="setManually" label-position="left"  label-width="120px">
      <el-form-item label="转人工按钮显示：">
        <el-switch
          v-model="setManually.showTransferBtn"
          active-color="#459ae9"
          inactive-color="#ccc">
        </el-switch><span class="prompt margin-l-10">默认“是”，转人工按钮将显示在对话框内</span>
      </el-form-item>
      <!-- <el-form-item label="触发词命中转人工：" style="margin-top: -5px">
        <el-switch
          v-model="setManually.openTriggerWord"
          active-color="#459ae9"
          inactive-color="#ccc">
        </el-switch><span class="prompt margin-l-10">开启后，访客发送的消息匹配到转人工触发词后，将自动转接人工客服，提高接待效率</span>
      </el-form-item>
      <el-form-item label="转人工触发词" v-show="setManually.openTriggerWord">
        <el-input v-model.trim="setManually.convert_words" placeholder="例如:人工,rg,转人工" size="mini" class="width-440"></el-input>
        <div class="prompt"><span class="prompt">温馨提示：<br/>1，可设置多个，多个触发词用英文逗号隔开。<br/>2，需要全部命中触发词，如：触发词为“转人工”则必须输入“转人工”才能转入人工。</span></div>
      </el-form-item> -->
    </el-form>
  </div>
</template>
<script>
  import {deepClone} from '@/utils/m7Utils'
  export default {
    name: 'baseConfig',
    data () {
      return {
        setManually: { // 转人工设置
          showTransferBtn: true,
          openTriggerWord: false,
          convert_words: ''
        }
      }
    },
    props: {
      form: {
        type: Object,
        default: function () {
          return {}
        }
      }
    },
    components: {
    },
    computed: {
    },
    methods: {
      open (val, isAdd) {
        if (isAdd) {
          this.setManually = {
            showTransferBtn: true,
            openTriggerWord: false,
            convert_words: ''
          }
        } else {
          for (let key in this.setManually) {
            console.log(this.setManually[key])
            this.setManually[key] = deepClone(val[key])
          }
        }
      }
    },
    mounted () {
    }
  }
</script>
<style lang="stylus" scoped>
  @import "../../../../../assets/common.styl"
  .margin-l-10
    margin-left 10px
  .width-440
    width 440px
  .prompt
    color $c-prompt
    line-height normal
    font-size 12px
</style>
